import {createRouter, createWebHashHistory} from 'vue-router'

import About from '../views/About.vue'
import Home from "../views/Home.vue";
import Parent from "../views/Parent.vue";
import Dashboard from "../views/Dashboard.vue";
import BaseDatasourceConfig from "../views/engine/BaseDatasourceConfig.vue";
import BaseFetcherConfig from "../views/engine/BaseFetcherConfig.vue";
import BaseRulesEngineConfig from "../views/engine/BaseRulesEngineConfig.vue"
import BaseRulesParamConfig from "../views/engine/BaseRulesParamConfig.vue"
import BaseRuleConfig from "../views/engine/BaseRuleConfig.vue"
import RulesEngineFlow from "../views/engine/RulesEngineFlow.vue"
import BaseBucketConfig from "../views/engine/BaseBucketConfig.vue";

import VisitTimesMonitor from "../views/monitor/VisitTimesMonitor.vue";

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    component: About
  },
  {
    path: '/app/view/rulesEngineFlow',
    name: 'rulesEngineFlow',
    component: RulesEngineFlow
  },
  {
    path: '/app',
    name: 'app',
    component: Parent,
    children: [
      {
        path: "dash",
        name: "dash",
        component: Dashboard
      }, {
        path: "baseDatasourceConfig",
        name: "baseDatasourceConfig",
        component: BaseDatasourceConfig
      }, {
        path: "baseFetcherConfig",
        name: "baseFetcherConfig",
        component: BaseFetcherConfig
      }, {
        path: "baseRulesEngineConfig",
        name: "baseRulesEngineConfig",
        component: BaseRulesEngineConfig
      }, {
        path: "baseRulesParamConfig",
        name: "baseRulesParamConfig",
        component: BaseRulesParamConfig
      }, {
        path: "baseRuleConfig",
        name: "baseRuleConfig",
        component: BaseRuleConfig
      }, {
        path: "baseBucketConfig",
        name: "baseBucketConfig",
        component: BaseBucketConfig
      }, {
        path: "monitor/visitTimesMonitor",
        name: "visitTimesMonitor",
        component: VisitTimesMonitor
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
